﻿using System.Collections.Generic;
using NRemedy.Linq;

namespace NRemedy.MVC.UI
{
    public class TreeRequest
    {
        public string FormName { get; set; }

        public string Top { get; set; }

        public string Qualification { get; set; }

        //说明数的深度
        public List<uint> FieldIds { get; set; }

        public List<ARNative.ARSortInfo> Sorts { get; set; }

        //说明要查询的字段
        public Dictionary<string, uint> SelectedFieldIds { get; set; }


        public List<uint> Merge()
        {
            List<uint> ret = new List<uint>();

            foreach (var i in FieldIds)
            {
                if(!ret.Contains(i))
                    ret.Add(i);
            }

            foreach (var k in SelectedFieldIds.Keys)
            {
                if (!ret.Contains(SelectedFieldIds[k]))
                    ret.Add(SelectedFieldIds[k]);
            }

            return ret;
        }
    }
}
